package arrayReset;

public class ArrayReset {
	int[] _defaultArray = { 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9};
	
	public void resetIntArray(int[] array){
		int length = array.length;
		for(int i = 0; i < length; i++){
			array[i] = _defaultArray[i];
		}
	}
	
	public static void main(String[] args) {
		int[] badArray = { 99, 123, 54, 37, 42, 51, 612, 12237, 58, 99};
		ArrayReset ar = new ArrayReset();
		System.out.println("Original Array:  ");
		int j = 0;
		for(int i: badArray){
			System.out.println(" Index " + j++ + " = " + i);
		}
		j=0;
		ar.resetIntArray(badArray); //Should reset it.
		
		System.out.println("\nNew Array:  ");
		j = 0;
		for(int i: badArray){
			System.out.println(" Index " + j++ + " = " + i);
		}
		
		//For remembering how .length works.
		int[] longArray = new int[1000];
		System.out.println(longArray.length);
	}

}
